<div>
    <czy-toolbar>
        <czy-toolbar-item>
            <span slot="label">机构名称</span>
            <span slot="item"><el-input v-model="queryParam.like.name"></el-input></span>
        </czy-toolbar-item>
        <czy-toolbar-btn>
            <el-button-group>
                <el-button type="primary" icon="search" size="small" @click="search">查询</el-button>
                <el-button type="primary" icon="plus" size="small" @click="toAdd(null)">新增</el-button>
            </el-button-group>
        </czy-toolbar-btn>
    </czy-toolbar>

    <el-table :data="pageData" border stripe highlight-current-row>
        <el-table-tree-column :expand-all="false" :remote="selectSubDept" parentKey="parentId"
                              levelKey="depth" childNumKey="childNum"
                              file-icon="fa fa-file" folder-icon="fa fa-folder"
                              prop="name" label="部门名称">
        </el-table-tree-column>
        <el-table-column prop="code" label="部门编码"></el-table-column>
        <el-table-column label="操作" width="135">
            <template scope="scope">
                <el-tooltip content="新增子级部门" placement="top" effect="light">
                    <el-button size="mini" type="primary" icon="plus" @click="toAdd(scope.row)"></el-button>
                </el-tooltip>
                <el-tooltip content="修改" placement="top" effect="light">
                    <el-button size="mini" type="warning" icon="edit" @click="toEdit(scope.row)"></el-button>
                </el-tooltip>
                <el-tooltip content="删除" placement="top" effect="light">
                    <el-button size="mini" type="danger" icon="delete"
                               @click="del(scope.row)"></el-button>
                </el-tooltip>
            </template>
        </el-table-column>
    </el-table>

    <edit @save-success="search" ref="edit"></edit>
</div>